<template>
  <div>
    <h2>父组件</h2>
    <h3>接收到的子组件数据：{{ receivedData }}</h3>
    <EmitChild @childSendDataToParent="getChildData"/>
  </div>
</template>

<script setup>
import EmitChild from "./EmitChild.vue";
import { ref } from "vue";

let receivedData = ref('暂未接收到数据');

function getChildData(data) {
  receivedData.value = data;
}
</script>